package leecode

import "strings"

// 判断字符串是否唯一
func isUnique(astr string) bool {
	wordMap := make(map[string]int, len(astr)) //key为字符串中的单词,value为出现的次数
	str := strings.Split(astr, "")
	for _, value := range str {
		_, ok := wordMap[value]
		if !ok {
			wordMap[value] = 1
		} else {
			return false
		}
	}
	return true
}
